import Vue from 'vue'
import App from './App.vue'
import Vuex from 'vuex'

Vue.config.productionTip = false
Vue.use(Vuex)

const store = new Vuex.Store({
  state:{
    count:0
  },
  mutations:{
    aaa:function(state,num){
      state.count += num
    }
  }
})

console.log(store.state.count)
store.commit('aaa',5)
console.log(store.state.count)

new Vue({
  //注入
  store:store,//或store,
  render: h => h(App),
}).$mount('#app')
